//package cn.stylefeng.guns.run;
//
//import cn.hutool.core.date.SystemClock;
//import cn.hutool.core.io.FileUtil;
//import cn.hutool.core.thread.ThreadUtil;
//import cn.hutool.core.util.StrUtil;
//import com.alibaba.fastjson.JSONObject;
//import lombok.extern.slf4j.Slf4j;
//import org.jsoup.Jsoup;
//import org.jsoup.nodes.Document;
//
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.Arrays;
//import java.util.List;
//
//@Slf4j
//public class Test {
//
//    public static void main(String[] args) throws IOException {
////        WeChatMsgSend swx = new WeChatMsgSend();
////        try {
////            String token = swx.getToken("wwd10c4d16064ab819", "Hsc1h_K0237XIbmgT9CiHUJjm1zqDp3GUeiEdk-0pg0");
////            String postdata = swx.createpostdata("13459446228", "text", 1000004, "content", "我看不见");
////            String resp = swx.post("utf-8", WeChatMsgSend.CONTENT_TYPE, (new WeChatUrlData()).getSendMessage_Url(), postdata, token);
////            System.out.println("获取到的token======>" + token);
////            System.out.println("请求数据======>" + postdata);
////            System.out.println("发送微信的响应数据======>" + resp);
////        } catch (IOException e) {
////            e.printStackTrace();
////        }
//
//        List<String> matchDatas = new ArrayList<>();
//        for (int i = 1; i <= 12; i++) {
//            for (int j = 1; j <= 31; j++) {
//                if (Arrays.asList(2, 4, 6, 9, 11).contains(i) && j == 31) {
//                    continue;
//                }
//                if (i == 2 && j > 28) {
//                    continue;
//                }
//                if (i == 7 && j == 7) {
//                    break;
//                }
//                String month = StrUtil.padPre(String.valueOf(i), 2, "0");
//                String day = StrUtil.padPre(String.valueOf(j), 2, "0");
////                System.out.println(StrUtil.format("{}-{}", month, day));
//                try {
//                    String matchData = getMatchData("2021", month, day);
//                    matchDatas.add(matchData);
//
//                } catch (Exception e) {
//                    log.error(StrUtil.format("{}-{},报错:{}", month, day, e.getMessage()));
//                }
//
//            }
//        }
//
//        FileUtil.writeLines(matchDatas, "E:\\乱七八糟\\aical.txt", "utf-8");
//
//    }
//
//
//    private static String getMatchData(String year, String month, String day) throws IOException {
////        String url = "http://live.aicai.com/static/no_cache/league/zc/jsbf/ttyq2020/jczq/jsbf_2021-07-03.json?v=1625621641791";
//        String url = StrUtil.format("http://live.aicai.com/static/no_cache/league/zc/jsbf/ttyq2020/jczq/jsbf_{}-{}-{}.json?v={}",
//                year, month, day, SystemClock.now());
//
//        Document doc = Jsoup.connect(String.format(url))
//                .ignoreContentType(true)
//                .userAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.15)")
//                .timeout(5000)
//                .get();
//        String body = doc.select("body").text();
//
//        JSONObject jsonObject = JSONObject.parseObject(body);
//        ThreadUtil.sleep(100);
//        return jsonObject.getString("matchList");
////        JSONArray matchList = jsonObject.getJSONArray("matchList");
////        for (int i = 0; i < matchList.size(); i++) {
////            JSONObject match = matchList.getJSONObject(i);
////
////            AicaiGame game = new AicaiGame();
////
////            String matchDate = match.getString("matchDate");
////            String matchTime = match.getString("matchTime");
////            game.setDate(DateUtil.parseDate(StrUtil.format("{} {}", matchDate, matchTime)));
////
////            String homeName = match.getString("homeName");
////            String awayName = match.getString("awayName");
////            game.setTeamAName(homeName);
////            game.setTeamBName(awayName);
////
////            String matchNoCn = match.getString("matchNoCn");
////            game.setMatchCn(matchNoCn.substring(0, 2));
////            game.setMatchNo(matchNoCn.substring(2));
////
////            System.out.println(game);
////        }
//
//
//    }
//}
//